package com.centit.framework.ip.templateFile.po;

import com.alibaba.fastjson.annotation.JSONField;
import org.hibernate.validator.constraints.Length;

import javax.persistence.*;

import java.util.Date;


/**
 * create by scaffold 2018-05-17 
 * @author codefan@sina.com
 
  C_TEMPLATE_FILEnull   
*/
@Entity
@Table(name = "C_TEMPLATE_FILE")
public class TemplateFile implements java.io.Serializable {
	private static final Long serialVersionUID =  1L;



	/**
	 * recordid 文书id 
	 */
	@Id
	@Column(name = "recordid")
	
	private String recordid;

	/**
	 * templateid 模板id 
	 */
	@Column(name = "templateid")
	private String  templateid;
	/**
	 * filename 文件名称 
	 */
	@Column(name = "filename")
	@Length(min = 0, max = 254, message = "字段长度不能小于{min}大于{max}")
	private String  filename;
	/**
	 * filetype 文件类型 
	 */
	@Column(name = "filetype")
	@Length(min = 0, max = 100, message = "字段长度不能小于{min}大于{max}")
	private String  filetype;
	/**
	 * filebody 文件内容 
	 */
	@Lob
	@Column(name = "filebody")
	private byte[]  filebody;
	/**
	 * username 上传人 
	 */
	@Column(name = "username")
	@Length(min = 0, max = 100, message = "字段长度不能小于{min}大于{max}")
	private String  username;
	/**
	 * isused 是否启用 
	 */
	@Column(name = "isused")
	@Length(min = 0, max = 1, message = "字段长度不能小于{min}大于{max}")
	private String  isused;
	/**
	 * temptype 模版类型 
	 */
	@Column(name = "temptype")
	@Length(min = 0, max = 100, message = "字段长度不能小于{min}大于{max}")
	private String  temptype;
	/**
	 * orderby 模版选择排序功能 
	 */
	@Column(name = "orderby")
	@Length(min = 0, max = 2, message = "字段长度不能小于{min}大于{max}")
	private String  orderby;
	/**
	 * filesize null 
	 */
	@Column(name = "filesize")
	private int  filesize;
	/**
	 * filedate null 
	 */
	@Column(name = "filedate")
	private Date  filedate;
	/**
	 * filepath null 
	 */
	@Column(name = "filepath")
	@Length(min = 0, max = 255, message = "字段长度不能小于{min}大于{max}")
	private String  filepath;
	/**
	 * descript null 
	 */
	@Column(name = "descript")
	@Length(min = 0, max = 255, message = "字段长度不能小于{min}大于{max}")
	private String  descript;
	/**
	 * codecode null 
	 */
	@Column(name = "codecode")
	@Length(min = 0, max = 100, message = "字段长度不能小于{min}大于{max}")
	private String  codecode;
	/**
	 * BOOKMARK null书签配置，逗号隔开
	 */
	@Column(name = "BOOKMARK")
	private String  bookmark;
	/**
	 * BOOKMARK null数据接口地址
	 */
	@Column(name = "dataurl")
	private String  dataurl;
	// Constructors
	/** default constructor */
	public TemplateFile() {
	}
	/** minimal constructor */
	public TemplateFile(
		String recordid		
		) {
	
	
		this.recordid = recordid;		
			
	}

/** full constructor */
	public TemplateFile(
	 String recordid		
	,String  templateid,String  filename,String  filetype,byte[] filebody ,String  username,String  isused,String  temptype,String  orderby,int  filesize,Date  filedate,String  filepath,String  descript,String  codecode,String bookmark,String dataurl) {


		this.recordid = recordid;

		this.templateid= templateid;
		this.filename= filename;
		this.filetype= filetype;
		this.filebody= filebody;
		this.username= username;
		this.isused= isused;
		this.temptype= temptype;
		this.orderby= orderby;
		this.filesize= filesize;
		this.filedate= filedate;
		this.filepath= filepath;
		this.descript= descript;
		this.codecode= codecode;
		this.bookmark=bookmark;
		this.dataurl=dataurl;
	}



	public String getRecordid() {
		return this.recordid;
	}

	public void setRecordid(String recordid) {
		this.recordid = recordid;
	}
	// Property accessors

	public String getTemplateid() {
		return this.templateid;
	}

	public void setTemplateid(String templateid) {
		this.templateid = templateid;
	}

	public String getFilename() {
		return this.filename;
	}

	public void setFilename(String filename) {
		this.filename = filename;
	}

	public String getFiletype() {
		return this.filetype;
	}

	public void setFiletype(String filetype) {
		this.filetype = filetype;
	}

	public byte[] getFilebody() {
		return this.filebody;
	}

	public void setFilebody(byte[] filebody) {
		this.filebody = filebody;
	}
  
	public String getUsername() {
		return this.username;
	}
	
	public void setUsername(String username) {
		this.username = username;
	}
  
	public String getIsused() {
		return this.isused;
	}
	
	public void setIsused(String isused) {
		this.isused = isused;
	}
  
	public String getTemptype() {
		return this.temptype;
	}
	
	public void setTemptype(String temptype) {
		this.temptype = temptype;
	}
  
	public String getOrderby() {
		return this.orderby;
	}
	
	public void setOrderby(String orderby) {
		this.orderby = orderby;
	}
  
	public int getFilesize() {
		return this.filesize;
	}
	
	public void setFilesize(int filesize) {
		this.filesize = filesize;
	}
  
	public Date getFiledate() {
		return this.filedate;
	}
	
	public void setFiledate(Date filedate) {
		this.filedate = filedate;
	}
  
	public String getFilepath() {
		return this.filepath;
	}
	
	public void setFilepath(String filepath) {
		this.filepath = filepath;
	}
  
	public String getDescript() {
		return this.descript;
	}
	
	public void setDescript(String descript) {
		this.descript = descript;
	}
  
	public String getCodecode() {
		return this.codecode;
	}
	
	public void setCodecode(String codecode) {
		this.codecode = codecode;
	}

	public String getBookmark() {
		return bookmark;
	}

	public void setBookmark(String bookmark) {
		this.bookmark = bookmark;
	}

	public String getDataurl() {
		return dataurl;
	}

	public void setDataurl(String dataurl) {
		this.dataurl = dataurl;
	}

	public TemplateFile copy(TemplateFile other){
  
		this.setRecordid(other.getRecordid());
  
		this.templateid= other.getTemplateid();  
		this.filename= other.getFilename();  
		this.filetype= other.getFiletype();  
		//this.filebody= other.getFilebody();  
		this.username= other.getUsername();  
		this.isused= other.getIsused();  
		this.temptype= other.getTemptype();  
		this.orderby= other.getOrderby();  
		this.filesize= other.getFilesize();  
		this.filedate= other.getFiledate();  
		this.filepath= other.getFilepath();  
		this.descript= other.getDescript();  
		this.codecode= other.getCodecode();
        this.bookmark=other.getBookmark();
        this.dataurl=other.getDataurl();
		return this;
	}
	
	public TemplateFile copyNotNullProperty(TemplateFile other){
  
	if( other.getRecordid() != null){
	this.setRecordid(other.getRecordid());}
  
		if( other.getTemplateid() != null){
		this.templateid= other.getTemplateid();}  
		if( other.getFilename() != null){
		this.filename= other.getFilename();}  
		if( other.getFiletype() != null){
		this.filetype= other.getFiletype();}  
		/*if( other.getFilebody() != null){
		this.filebody= other.getFilebody();}*/
		if( other.getUsername() != null){
		this.username= other.getUsername();}  
		if( other.getIsused() != null){
		this.isused= other.getIsused();}  
		if( other.getTemptype() != null){
		this.temptype= other.getTemptype();}  
		if( other.getOrderby() != null){
		this.orderby= other.getOrderby();}  
		if( other.getFilesize() != 0){
		this.filesize= other.getFilesize();}  
		if( other.getFiledate() != null){
		this.filedate= other.getFiledate();}  
		if( other.getFilepath() != null){
		this.filepath= other.getFilepath();}  
		if( other.getDescript() != null){
		this.descript= other.getDescript();}  
		if( other.getCodecode() != null){
		this.codecode= other.getCodecode();}		
        if(other.getBookmark()!=null){
			this.bookmark=other.getBookmark();
		}
		if(other.getDataurl()!=null){
        	this.dataurl=other.getDataurl();
		}
		return this;
	}

	public TemplateFile clearProperties(){
  
		this.templateid= null;  
		this.filename= null;  
		this.filetype= null;  
		this.filebody= null;  
		this.username= null;  
		this.isused= null;  
		this.temptype= null;  
		this.orderby= null;  
		this.filesize= 0;
		this.filedate= null;  
		this.filepath= null;  
		this.descript= null;  
		this.codecode= null;
		this.bookmark=null;
		this.dataurl=null;
		return this;
	}
}
